﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace AirlineClient
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            
            Info info = new Info();
            info._Currency = "VND";
            info._DepartCity = "HAN";
            info._DepDay = "25";
            info._DepMonth = "DEC";
            info._ArriveCity = "SGN";
            info._ReturnDay = "31";
            info._ReturnMonth = "DEC";
            info._FlightStructure = "returntravel";
            info._ADT = "1";
            info._CHD = "0";
            info._INFANT = "0";
             
            /*
            Info info = new Info();
            info._Currency = "VND";
            info._DepartCity = "Hà Nội (HAN)";
            info._DepartDay = "24/12/2012";
            info._ArriveCity = "Thành phố Hồ Chí Minh (SGN)";
            info._ArriveDay = "31/12/2012";
            info._FlightStructure = "RoundTrip";
            info._ADT = "1";
            info._CHD = "0";
            info._INFANT = "0";
            */

            //booking ticket of VietnamAirline
            ClientProcess p = new ClientProcess();
            List<List<FlightInfo>> result = p.GetAllFlightOfVietNamAirline(info);
            p.DepartTicketSelected = result[0][0]._Tickets[0];
            p.ArriveTicketSelected = result[1][0]._Tickets[0];
            string baseFare = (p.DepartTicketSelected._Basefare + p.ArriveTicketSelected._Basefare).ToString();
            string total = (p.DepartTicketSelected._PriceTotal + p.ArriveTicketSelected._PriceTotal + 50000).ToString();
            string code = p.GetBookingCode(p.DepartTicketSelected._Value, p.ArriveTicketSelected._Value, info._FlightStructure, info._DepartCity,
                                            info._DepDay, info._DepMonth, info._ArriveCity, info._ReturnDay, info._ReturnMonth, info._ADT, "MR", "Nguyen", "Huy", "167", "897650", "83", "894032",
                                            "nguyenhuy@gmail.com", total, baseFare, "VCB ATM machines");

            //p.GetAllFlightOfJetStar(info);
        }
    }
}
